<template>
    <div class="box">
        <headers title="详情"></headers>
        <van-tabs v-model:active="active">
            <van-tab title="商品">
                <swipers :swiper="detail.pics"></swipers>
                <p>{{ detail.goods_name }}</p>
                <p>{{ detail.goods_price }} </p>
            </van-tab>
            <van-tab title="详情">
                <div v-html="detail.goods_introduce"></div>
            </van-tab>
            <van-tab title="评价">内容 3</van-tab>
        </van-tabs>

        <van-action-bar style="height: 5rem;">
            <van-action-bar-icon icon="chat-o" text="客服" dot />
            <van-action-bar-icon icon="cart-o" text="购物车" badge="5" />
            <van-action-bar-icon icon="shop-o" text="店铺" badge="12" />
            <van-action-bar-button type="warning" text="加入购物车" />
            <van-action-bar-button type="danger" text="立即购买" />
        </van-action-bar>


    </div>
</template>

<script setup>
import { ref } from "vue";
import { swiperdataApi, catitemsApi, categoriesApi, searchApi, detailApi } from "@/api/api";
import { useRoute, useRouter } from 'vue-router'

const router = useRouter()
const route = useRoute()

import headers from '@/components/headers.vue';
import swipers from "@/components/swipers.vue";

let goods_id = ref(route.query.goods_id);

const active = ref(0);

let detail = ref([]);
const getdetailApi = () => {
    detailApi(goods_id.value).then((res) => {
        detail.value = res.data.message
    })
}
getdetailApi();


</script>

<style lang="scss" scoped>
.box {
    width: 100%;
    height: 100%;
}
</style>